package com.ncloud.resman.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface DictMapper {

	@Select("select dict_key `key`,dict_value `value` from sys_dictionary where dictionary_id=#{dictId}")
	List<Map<String, String>> getDictListById(String dictId);
	
	@Select("select dict_value `value` from sys_dictionary where dictionary_id=#{dictId} and dict_key = #{key}")
	String getDictValueByIdAndKey(@Param("dictId")String dictId,@Param("key")String key);
	
	@Select("select dict_key `key` from sys_dictionary where dictionary_id=#{dictId} and dict_value = #{value}")
	String getDictKeyByIdAndValue(@Param("dictId")String dictId,@Param("value")String value);
}
